package com.tao.friend.controller;

import cn.hutool.db.meta.Table;
import com.github.pagehelper.PageInfo;
import com.tao.common.creo.controller.BaseController;
import com.tao.common.creo.domain.PageQueryDTO;
import com.tao.common.creo.domain.TableDataInfo;
import com.tao.friend.domain.exam.dto.ExamQueryDTO;
import com.tao.friend.service.IExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/exam")
public class ExamController extends BaseController {


    @Autowired
    IExamService examService;

    /**
     * 获取竞赛列表(数据库版)
     * @param examQueryDTO
     * @return
     */
    @GetMapping("/semiLogin/list")
    public TableDataInfo list(ExamQueryDTO examQueryDTO) {
        return  getTableDataInfo(examService.list(examQueryDTO));
    }

    /**
     * 获取竞赛列表(redis)
     */
    @GetMapping("/semiLogin/redis/list")
    public TableDataInfo redisList(ExamQueryDTO examQueryDTO) {
        return examService.redisList(examQueryDTO);
    }

}
